package nc.ui.test2.inhome.billref;

import nc.bs.framework.common.NCLocator;
import nc.itf.test2.IOrderBillMaintain;
import nc.ui.pubapp.billref.src.RefContext;
import nc.ui.pubapp.uif2app.query2.model.IRefQueryService;
import nc.ui.querytemplate.querytree.IQueryScheme;

public class QueryForCH02Service implements IRefQueryService{

	private RefContext refContext;
	
	@Override
	public Object[] queryByWhereSql(String condition) throws Exception {
		
		IOrderBillMaintain query = NCLocator.getInstance().lookup(IOrderBillMaintain.class);
		return query.query(condition);
	}

	@Override
	public Object[] queryByQueryScheme(IQueryScheme paramIQueryScheme)
			throws Exception {
		
		String condition = null;
		
		if(paramIQueryScheme.getWhereSQLOnly() == null){
			condition = "1=1";
		}else{
			condition = paramIQueryScheme.getWhereSQLOnly();
		}
		
		return queryByWhereSql(condition);
	}

	public RefContext getRefContext() {
		return refContext;
	}

	public void setRefContext(RefContext refContext) {
		this.refContext = refContext;
	}

}
